<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>购物车</title>

    <link rel="stylesheet" href="/static/js/layui-v2.5.7/layui/css/layui.css" media="all">
    <script type="text/javascript" src="/static/js/layui-v2.5.7/layui/layui.js"></script>
    <script type="text/javascript" src="/static/js/myJs.js"></script>

</head>
<body>

<table class="layui-table">
    <colgroup>
    </colgroup>
    <thead>
    <tr>
        <th>ID</th>
        <th>名字</th>
    </tr>
    </thead>
    <tbody id="tbody">
    </tbody>
</table>

<script>
    $.ajax({
        dataType: 'json',
        url: '/studentLayer/Shopping/ajaxCart',
        type: 'POST',
        success: function (data) {
            //  console.log(data);

            if(data.status==0){

            }else{
                var html;
                $.each(data,function (index,value) {
                   // console.log(index, value);

                    html = html +
                        "<tr>"
                        + "<td>"
                        + value.id
                        + "</td>"
                        + "<td>"
                        + value.name
                        + "</td>"
                        + "</tr>";
                })
                    $("#tbody").html(html);
            }
        }
    })

</script>


</body>
</html>